FC=gfortran
MAIN=main.f90
TAR=main.out
SRCS= ./stack_mod.f90 ./reverse_polish_mod.f90 $(MAIN)
OBJS=$(patsubst %.f90,$(OBJ)%.o,$(SRCS))
FFLAGS= -fcheck=all -Wall
$(TAR):$(OBJS)
	$(FC)  $^ $(FFLAGS) -o $@
$(OBJ)%.o:%.f90
	$(FC) -c $^ $(FFLAGS) -o $@
.PHONY:clean
clean:
	rm *.mod *.o $(TAR)
